import request from '@/config/axios'

// B 站视频评论 VO
export interface VideoCommentVO {
  id: number // 自增ID
  userId: string // 用户ID
  nickname: string // 用户昵称
  avatar: string // 用户头像地址
  addTs: number // 记录添加时间戳
  lastModifyTs: number // 记录最后修改时间戳
  commentId: string // 评论ID
  videoId: string // 视频ID
  content: string // 评论内容
  subCommentCount: string // 评论回复数
}

// B 站视频评论 API
export const VideoCommentApi = {
  // 查询B 站视频评论分页
  getVideoCommentPage: async (params: any) => {
    return await request.get({ url: `/bilibili/video-comment/page`, params })
  },

  // 查询B 站视频评论详情
  getVideoComment: async (id: number) => {
    return await request.get({ url: `/bilibili/video-comment/get?id=` + id })
  },

  // 新增B 站视频评论
  createVideoComment: async (data: VideoCommentVO) => {
    return await request.post({ url: `/bilibili/video-comment/create`, data })
  },

  // 修改B 站视频评论
  updateVideoComment: async (data: VideoCommentVO) => {
    return await request.put({ url: `/bilibili/video-comment/update`, data })
  },

  // 删除B 站视频评论
  deleteVideoComment: async (id: number) => {
    return await request.delete({ url: `/bilibili/video-comment/delete?id=` + id })
  },

  // 导出B 站视频评论 Excel
  exportVideoComment: async (params) => {
    return await request.download({ url: `/bilibili/video-comment/export-excel`, params })
  }
}